import React, { FC } from 'react';
import { Form, Input, Button, Checkbox } from 'antd';
import { connect, Dispatch } from 'umi';
import { ConnectState } from '@/models/connect';
import 'antd/dist/antd.css';
import { creator } from '@/utils/creator';

export interface LoginProps {
  dispatch: Dispatch;
  login: ConnectState;
  loading: boolean;
}

const Login: FC<LoginProps> = ({ dispatch }) => {
  const onFinish = (values: any) => {
    dispatch(creator('user/login', values));
  };

  const onFinishFailed = (errorInfo: any) => {
    console.log('Failed:', errorInfo);
  };

  return <div>home</div>;
};

export default connect(({ user }: { user: ConnectState }) => ({ user }))(Login);
